<template>
  <div class="admin-center-container">
    <div class="page-header">
      <h2>管理员中心</h2>
      <div class="header-actions">
        <button class="btn-primary">刷新数据</button>
        <button class="btn-secondary">导出报告</button>
      </div>
    </div>
    
    <div class="admin-stats">
      <div class="stat-card">
        <div class="stat-icon">👥</div>
        <div class="stat-content">
          <h3>用户总数</h3>
          <p class="stat-number">156</p>
          <span class="stat-change positive">+8%</span>
        </div>
      </div>
      
      <div class="stat-card">
        <div class="stat-icon">📚</div>
        <div class="stat-content">
          <h3>知识总数</h3>
          <p class="stat-number">1,234</p>
          <span class="stat-change positive">+15%</span>
        </div>
      </div>
      
      <div class="stat-card">
        <div class="stat-icon">✅</div>
        <div class="stat-content">
          <h3>待审核</h3>
          <p class="stat-number">23</p>
          <span class="stat-change negative">-5%</span>
        </div>
      </div>
      
      <div class="stat-card">
        <div class="stat-icon">📈</div>
        <div class="stat-content">
          <h3>活跃度</h3>
          <p class="stat-number">89%</p>
          <span class="stat-change positive">+3%</span>
        </div>
      </div>
    </div>
    
    <div class="admin-content">
      <div class="management-section">
        <h3>管理功能</h3>
        <div class="function-grid">
          <div class="function-card">
            <div class="function-icon">👥</div>
            <div class="function-content">
              <h4>用户管理</h4>
              <p>管理用户账户和权限</p>
              <button class="btn-sm">进入</button>
            </div>
          </div>
          
          <div class="function-card">
            <div class="function-icon">📝</div>
            <div class="function-content">
              <h4>内容管理</h4>
              <p>审核和管理知识内容</p>
              <button class="btn-sm">进入</button>
            </div>
          </div>
          
          <div class="function-card">
            <div class="function-icon">📊</div>
            <div class="function-content">
              <h4>数据报告</h4>
              <p>查看系统使用统计</p>
              <button class="btn-sm">进入</button>
            </div>
          </div>
          
          <div class="function-card">
            <div class="function-icon">⚙️</div>
            <div class="function-content">
              <h4>系统设置</h4>
              <p>配置系统参数</p>
              <button class="btn-sm">进入</button>
            </div>
          </div>
        </div>
      </div>
      
      <div class="recent-activity">
        <h3>最近活动</h3>
        <div class="activity-list">
          <div class="activity-item">
            <span class="activity-icon">👤</span>
            <div class="activity-content">
              <p>新用户 李四 注册成功</p>
              <span class="activity-time">10分钟前</span>
            </div>
          </div>
          <div class="activity-item">
            <span class="activity-icon">✅</span>
            <div class="activity-content">
              <p>审核通过了《Vue.js 教程》</p>
              <span class="activity-time">30分钟前</span>
            </div>
          </div>
          <div class="activity-item">
            <span class="activity-icon">📝</span>
            <div class="activity-content">
              <p>用户 王五 创建了新知识</p>
              <span class="activity-time">1小时前</span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
// 管理员中心组件逻辑
</script>

<style scoped>
.admin-center-container {
  padding: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.page-header h2 {
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.btn-primary {
  background: #4f46e5;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
}

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 0.5rem;
}

.stat-content {
  flex: 1;
}

.stat-content h3 {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 0 0.5rem 0;
}

.stat-number {
  color: #1f2937;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
}

.stat-change {
  font-size: 0.75rem;
  font-weight: 500;
}

.stat-change.positive {
  color: #059669;
}

.stat-change.negative {
  color: #dc2626;
}

.admin-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.management-section,
.recent-activity {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.management-section h3,
.recent-activity h3 {
  color: #1f2937;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.function-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.function-card {
  background: #f9fafb;
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.function-icon {
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 0.375rem;
}

.function-content {
  flex: 1;
}

.function-content h4 {
  color: #1f2937;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.function-content p {
  color: #6b7280;
  font-size: 0.75rem;
  margin: 0 0 0.5rem 0;
}

.btn-sm {
  background: #4f46e5;
  color: white;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.75rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.activity-icon {
  font-size: 1.25rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 0.375rem;
}

.activity-content {
  flex: 1;
}

.activity-content p {
  color: #1f2937;
  font-size: 0.875rem;
  margin: 0 0 0.25rem 0;
}

.activity-time {
  color: #6b7280;
  font-size: 0.75rem;
}

@media (max-width: 768px) {
  .admin-content {
    grid-template-columns: 1fr;
  }
  
  .admin-stats {
    grid-template-columns: 1fr;
  }
  
  .function-grid {
    grid-template-columns: 1fr;
  }
}
</style>
